# # 三种格式化
# name = "CBB"
# age = 18
# # 方法一
# result1 = "大家好，我是%s"%(name)
#
# # 方法二
# result2 = "大家好，我是{}，使用格式化方法二 今年{}"format(name,age)
#
# # 方法三
# result3 = f"大家好，我是{name}使用格式化方法二 今年{age}"
# print(result3)
#
# # 常见字符串操作:字符串，替换，分割，去除两端空格，索引，切片
# str1 = "我是第一个字符串"
# str2 = "我是第二个字符串"
# print(str1+str2)
#
# str_replace = "常见字符串操作:字符串，替换，分割，去除两端空格，索引，切片"
# print(str_replace.replace("、","--"))
# print(str_replace.replace("、","++"))
# print(str_replace.replace("分割","  "))
#
# # 字符串分割
# str_split = "1 2 3 4 5 7 8 9"
# str_list =str_split .split()
# print(str_split)
#
#
# str2_split = str_split.replace("  ",":")
# print(str2_split)
# str_list2 = str2_split.split(":")
# print(str_list2)
#
# # 字符串去除两端空格
# str_strip = "  我是2401班的学生林晓露"
# print(str_strip.strip)
# str_strip = "&&&&&&&我是2401班的学生林晓露&&&&&&&"
# print(str_strip.strip("&"))

# 字符串索引，切片
str_python = "python"
print(str_python[0])
print(str_python[1])
print(str_python[2])
print(str_python[3])
print(str_python[4])
print(str_python[5])

for i in str_python:
    print(i)

